package interaction.sampling.matching;

import interaction.sampling.Sample;
import interaction.sampling.SampleSet;

public class MatcherCollection implements Matcher {
	private Matcher[] matchers = new Matcher[] {
		new DeltaRangeLengthMatcher(),
		new LevelLengthMatcher(),
		new SpectrumMatcher(),
		new SoundLevelMatcher(),
	};

	public double getAcceptanceTreshold() {
		return -10;
	}

	public double match(Sample test, SampleSet comparison) {
		double rating = 0;
		for (Matcher m : matchers) {
			double match = m.match(test, comparison);
			rating += (match - m.getAcceptanceTreshold()) / (-m.getAcceptanceTreshold());
		}
		return rating;
	}

}
